<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>用户列表</title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.css}"></link>
</head>
<body class="container" style="width: 70%;">
<div th:replace="layout/header :: header"></div>

<content>
    <div>
        <br/>
        <h1>用户列表</h1>
        <br/><br/>
        <div class="with:80%">
            <table class="table table-hover">
                <thead>
                <tr>
                    <!--<th>#</th>-->
                    <th>用户名</th>
                    <th>类型</th>
                    <th>状态</th>
                    <th>注册时间</th>
                    <th>查看</th>
                    <th>管理</th>
                </tr>
                </thead>
                <tbody>
                <tr  th:each="user : ${pageBean.data}">
                    <!--<th scope="row" th:text="${user.id}">1</th>-->
                    <td th:text="${user.username}">neo</td>
                    <td th:text="${user.userType}">neo@126.com</td>
                    <td th:text="${user.userStatus == 0 ? '审核中': '通过'}">User</td>
                    <td th:text="${#dates.format(user.createTime, 'yyyy-MM-dd HH:mm:ss')}">6</td>
                    <td><a th:href="@{/user_detail/(id=${user.id})}">详情</a></td>
                    <td><a th:href="@{/check_user(id=${user.id})}"  th:if="${user.userType !='admin'}" >审核</a></td>
                </tr>
                </tbody>
            </table>
            <!-- <div th:include="page :: pager" th:remove="tag"></div>-->
        </div>

        <div class="form-group">
            <div class="col-sm-2 control-label">
                <a th:href="@{/adduser}" class="btn btn-info" th:text="添加用户">添加用户</a>
            </div>
        </div>

        <br />

        <div class="row">
            <ul class="pagination" style="float: right;">

                <div th:if="${pageBean.pagebar!=null}" th:remove="tag">

                <li th:if="${pageBean.currentpage != pageBean.previouspage}"><a th:href="@{/users(currentPage=${pageBean.previouspage})}">上一页</a></li>

                <div th:each="num : ${pageBean.pagebar}" th:remove="tag">
                    <li th:if="${pageBean.currentpage == num}" class="disabled"><a th:text="${num}" href="#"></a></li>
                    <li th:if="${pageBean.currentpage != num}"><a th:text="${num}" th:href="@{/users(currentPage=${num})}"></a></li>
                </div>

                <li th:if="${pageBean.currentpage != pageBean.nextpage}"><a th:href="@{/users(currentPage=${pageBean.nextpage})}">下一页</a></li>
                </div>
            </ul>
        </div>

    </div>
</content>
</body>
</html>
